package com.huffman.smart_picture.common.exception;

import lombok.Data;

/**
 * @author: LinDeng
 * @date: 2024-02-23 19:57
 * @description: 业务异常
 */
@Data
public class BusinessException extends RuntimeException {
    private Integer code;
    private String message;
    private String description;

    public BusinessException(ErrorEnum paramEmpty, String message, String description) {
        super(message);
        this.code = paramEmpty.getCode();
        this.message = message;
        this.description = description;
    }

    public BusinessException(ErrorEnum paramEmpty, String description) {
        super(paramEmpty.getMessage());
        this.code = paramEmpty.getCode();
        this.message = paramEmpty.getMessage();
        this.description = description;
    }

    public BusinessException(String message,String description){
        this.code = ErrorEnum.SYSTEM_ERROR.getCode();
        this.message = message;
        this.description = description;
    }

}